#ifndef _HCC_ERROR_CODE_MID_HTTP_H_
#define _HCC_ERROR_CODE_MID_HTTP_H_

#include "ofc/ofc_types.h"
#include "hcc/hcc_error_code.h"
#include "hcc/hcc_error_code_mid.h"

#ifdef __cplusplus
extern "C" {
#endif

// 不含行号的错误码生成
#define HCC_MAKE_MID_HTTP_ERROR(error_code) (int)HCC_MAKE_MID_WARE_ERROR(kHccMidWareCurlHttp, error_code, HCC_ERROR_LEVEL_ERROR)
// 含行号的错误码生成
#define HCC_MAKE_MID_HTTP_ERROR_LINE(error_code) (int)HCC_ERROR(HCC_MAKE_MID_WARE_ERROR(kHccMidWareCurlHttp, error_code, HCC_ERROR_LEVEL_ERROR))


/**
 * Curl的Http:
 */
enum THccMidHttpErrorCodeTag
{
	kHccHttpSuccess	=	HCC_ERROR_SUCCESS,			///< 成功,没有错误
	kHccHttpNotFinish	=	HCC_MAKE_MID_HTTP_ERROR(1),			///<未下载完成
	kHccHttpMd5NotCompare	=	HCC_MAKE_MID_HTTP_ERROR(2),			///<md5不匹配
	kHccHttpMd5DoCalc	=	HCC_MAKE_MID_HTTP_ERROR(3),			///<正在校验
	kHccHttpWriteError	=	HCC_MAKE_MID_HTTP_ERROR(4),			///<写入错误
	kHccHttpWriteOutRange	=	HCC_MAKE_MID_HTTP_ERROR(5),			///<写入超出范围
	kHccHttpWriteExist	=	HCC_MAKE_MID_HTTP_ERROR(6),			///<数据已存在，不能写入
	kHccHttpPkgError	=	HCC_MAKE_MID_HTTP_ERROR(7),			///<包序号错误
	kHccHttp404Error	=	HCC_MAKE_MID_HTTP_ERROR(8),			///<404错误
	kHccHttpGetRangeError	=	HCC_MAKE_MID_HTTP_ERROR(9),			///<获取下载错误
	kHccHttpNoTask	=	HCC_MAKE_MID_HTTP_ERROR(10),			///<没有下载任务
	kHccHttpDownloadTooMuchError	=	HCC_MAKE_MID_HTTP_ERROR(11),			///<下载错误超过阈值
	kHccHttpDownloadTooMuchReconnect	=	HCC_MAKE_MID_HTTP_ERROR(12),			///<重连超过阈值
	kHccHttpDownloadStateError	=	HCC_MAKE_MID_HTTP_ERROR(13),			///<状态异常
	kHccHttpDownloadHeadError	=	HCC_MAKE_MID_HTTP_ERROR(14),			///<文件头错误
	kHccHttpDownloadEventIdError	=	HCC_MAKE_MID_HTTP_ERROR(15),			///<事件ID错误
	kHccHttpFileSizeError	=	HCC_MAKE_MID_HTTP_ERROR(16),			///<文件长度错误
	kHccHttpBusy	=	HCC_MAKE_MID_HTTP_ERROR(17),			///<服务正忙或内存不够分配不出客户端(过一段时间重试)
	kHccHttpStatusCodeError	=	HCC_MAKE_MID_HTTP_ERROR(18),			///<状态码错误
	kHccHttpInvaildParam	=	HCC_MAKE_MID_HTTP_ERROR(19),			///<无效参数
	kHccHttpMemAllocError	=	HCC_MAKE_MID_HTTP_ERROR(20),			///<内存分配失败
	kHccHttpConditionNoCorrect	=	HCC_MAKE_MID_HTTP_ERROR(21),			///<条件不满足 (在停止状态调用pause 或在运行状态调用启动
	kHccHttpLockInitFail	=	HCC_MAKE_MID_HTTP_ERROR(22),			///<锁初始化失败 (只在初始化时返回)
	kHccHttpUnConnect	=	HCC_MAKE_MID_HTTP_ERROR(23),			///<未连接
	kHccHttpFileError	=	HCC_MAKE_MID_HTTP_ERROR(24),			///<文件错误 (文件大小有问题，或者文件路径不对)
	kHccHttpTimeout	=	HCC_MAKE_MID_HTTP_ERROR(25),			///<超时
	kHccHttpConnectFail	=	HCC_MAKE_MID_HTTP_ERROR(26),			///<连接失败
	kHccHttpUnknownError	=	HCC_MAKE_MID_HTTP_ERROR(27),			///<未知错误  (web_client组件定义的其他错误)
	kHccHttpLockTimeOut	=	HCC_MAKE_MID_HTTP_ERROR(28),			///<加锁超时
};
typedef enum THccMidHttpErrorCodeTag THccMidHttpErrorCode;


typedef Int32 THccMidHttpErrorCodeLine;
#define kHccHttpSuccessLine	HCC_ERROR_SUCCESS	///< 成功,没有错误
#define kHccHttpNotFinishLine	HCC_MAKE_MID_HTTP_ERROR_LINE(1)	///<未下载完成
#define kHccHttpMd5NotCompareLine	HCC_MAKE_MID_HTTP_ERROR_LINE(2)	///<md5不匹配
#define kHccHttpMd5DoCalcLine	HCC_MAKE_MID_HTTP_ERROR_LINE(3)	///<正在校验
#define kHccHttpWriteErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(4)	///<写入错误
#define kHccHttpWriteOutRangeLine	HCC_MAKE_MID_HTTP_ERROR_LINE(5)	///<写入超出范围
#define kHccHttpWriteExistLine	HCC_MAKE_MID_HTTP_ERROR_LINE(6)	///<数据已存在，不能写入
#define kHccHttpPkgErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(7)	///<包序号错误
#define kHccHttp404ErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(8)	///<404错误
#define kHccHttpGetRangeErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(9)	///<获取下载错误
#define kHccHttpNoTaskLine	HCC_MAKE_MID_HTTP_ERROR_LINE(10)	///<没有下载任务
#define kHccHttpDownloadTooMuchErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(11)	///<下载错误超过阈值
#define kHccHttpDownloadTooMuchReconnectLine	HCC_MAKE_MID_HTTP_ERROR_LINE(12)	///<重连超过阈值
#define kHccHttpDownloadStateErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(13)	///<状态异常
#define kHccHttpDownloadHeadErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(14)	///<文件头错误
#define kHccHttpDownloadEventIdErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(15)	///<事件ID错误
#define kHccHttpFileSizeErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(16)	///<文件长度错误
#define kHccHttpBusyLine	HCC_MAKE_MID_HTTP_ERROR_LINE(17)	///<服务正忙或内存不够分配不出客户端(过一段时间重试)
#define kHccHttpStatusCodeErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(18)	///<状态码错误
#define kHccHttpInvaildParamLine	HCC_MAKE_MID_HTTP_ERROR_LINE(19)	///<无效参数
#define kHccHttpMemAllocErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(20)	///<内存分配失败
#define kHccHttpConditionNoCorrectLine	HCC_MAKE_MID_HTTP_ERROR_LINE(21)	///<条件不满足 (在停止状态调用pause 或在运行状态调用启动
#define kHccHttpLockInitFailLine	HCC_MAKE_MID_HTTP_ERROR_LINE(22)	///<锁初始化失败 (只在初始化时返回)
#define kHccHttpUnConnectLine	HCC_MAKE_MID_HTTP_ERROR_LINE(23)	///<未连接
#define kHccHttpFileErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(24)	///<文件错误 (文件大小有问题，或者文件路径不对)
#define kHccHttpTimeoutLine	HCC_MAKE_MID_HTTP_ERROR_LINE(25)	///<超时
#define kHccHttpConnectFailLine	HCC_MAKE_MID_HTTP_ERROR_LINE(26)	///<连接失败
#define kHccHttpUnknownErrorLine	HCC_MAKE_MID_HTTP_ERROR_LINE(27)	///<未知错误  (web_client组件定义的其他错误)
#define kHccHttpLockTimeOutLine	HCC_MAKE_MID_HTTP_ERROR_LINE(28)	///<加锁超时

//旧版本适配补丁
#define kHccHttpDownloadFileSizeError kHccHttpFileSizeError
#define kHccHttpUnconnnect kHccHttpUnConnect
#define kHccHttpConnectTimeout kHccHttpTimeout
#define kHccHttpConnnectFail kHccHttpConnectFail
#define kHccHttpLockTimeout kHccHttpLockTimeOut


#ifdef __cplusplus
}  // extern "C"
#endif

#endif // _HCC_ERROR_CODE_MID_HTTP_H_
/**
 * @
 */
